package com.xdf.xzymanagementsystem.dao;

import com.xdf.xzymanagementsystem.entity.BillType;
import com.xdf.xzymanagementsystem.entity.DeliveryList;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @program: xzy-management-system
 * @description:
 * @author: 张柯
 * @create: 2021-01-07 16:42
 **/
@Repository
public interface CallProcedureMapper {
    String salesOrderCodeGen(String prefix);

    String salesPlanCodeGen(String prefix);

    String deliveryCodeGen(String prefix);

    String deliveryBillCodeGen(String prefix);

    String productCodeGen(String prefix);

    List<Map<String, Object>> getSalesOrderReport(@Param("start") Date start, @Param("end") Date end,@Param("audit") Integer audit);
    List<Map<String, Object>> getSalesOrderReportCustomer(@Param("start") Date start, @Param("end") Date end,@Param("audit") Integer audit);
    List<Map<String, Object>> getSalesPlanReport(@Param("start") Date start, @Param("end") Date end);

    List<Map<String, Object>> getPlanReport(@Param("start") Date start, @Param("end") Date end);
    List<Map<String, Object>> getExecPlanReport(@Param("start") Date start, @Param("end") Date end);

    List<Map<String, Object>> getPurchaseOrderReport(@Param("start") Date start, @Param("end") Date end);

    List<Map<String, Object>> getMaterialOrderBillReport(@Param("start") Date start, @Param("end") Date end);

    List<Map<String, Object>> getMaterialStoreReport();
    List<Map<String, Object>> getMaterialStoreReport8Store(@Param("storeSid") String storeSid);

    List<Map<String, Object>> getMeterialTotalReport(@Param("start") Date start, @Param("end") Date end, @Param("storeId") String storeId);

    List<Map<String, Object>> getDeliveryPlanReport(@Param("start") Date start, @Param("end") Date end, @Param("mode") Integer mode);

    List<Map<String, Object>> getPlanReportSummary(@Param("start") Date start, @Param("end") Date end);

    List<Map<String, Object>> getPlanReportRegisteDtl(Long id);

    List<Map<String, Object>> getPlanReportRegisteDtl2(@Param("machineCode") String machineCode, @Param("isFinished") boolean isFinished);
    List<Map<String, Object>> getExecPlanReportRegisteDtl2(@Param("machineCode") String machineCode, @Param("isFinished") boolean isFinished);

    List<Map<String, Object>> getMaterialList();

    List<Map<String, Object>> getProductOrderReport(@Param("start") Date start, @Param("end") Date end);

    // 成品库存表
//    List<Map<String, Object>> getProductOrderStorage();
//    List<List<Map<String, Object>>> getProductOrderStorage();

    // 成品库存表 - 盘点
    List<Map<String, Object>> getProductOrderStoragePD(@Param("lastId") Long lastId,@Param("lastDate") Date lastDate);
    // 成品库存表 - 盘点 - 多结果集
//    List<List<Map<String,Object>>> getProductOrderStoragePDMult();
    List<Map<String,Object>> getProductOrderStoragePDMult();

    List<Map<String, Object>> getDeliveryBillReport(@Param("start") Date start, @Param("end") Date end);

    List<Map<String, Object>> getUnfinishedDeliveryPlan();

    List<Map<String, Object>> getUnfinishedDeliveryPlanDataSource(Integer contactCompanyId);

    List<Map<String, Object>> getNondeliveryPlanOrderReport();

    List<Map<String, Object>> getOutboundProductOrderReport(@Param("start") Date start, @Param("end") Date end);

    // 出货一览表
    List<Map<String, Object>> getDeliveryList(@Param("start") Date start, @Param("end") Date end);

    List<Map<String, Object>> getStatementOfAccountReport(@Param("start") Date start, @Param("end") Date end);

    BigDecimal getMaterialStorage(@Param("storageId") String storageId, @Param("productCoded") String productCoded);

    List<Map<String, Object>> getPurchaseOrderList(String productCoded);

    List<Long> getDeliveryList2Price();

    List<Long> getDeliveryListNoPrice();

    List<Map<String, Object>> getFuzzylookupSalesorderProductFile(String filter);

    List<DeliveryList> getDeliveryListNoPrice4Fix();
    List<DeliveryList> getDeliveryList2Price4Fix();
    List<Map<String,Object>> getAllDeliveryListIds();
    Integer updateSalesPrice(Long id);
    Integer updateDeliveryPlanPrice(Long id);
    Integer updateProductOrderPrice(Long id);
    Integer updateStatementAccount(Long id);
//    List<Map<String,Object>> getInoutProductOrder(@Param("sdate") Date sdate,@Param("edate") Date edate,@Param("lastId") Long lastId,@Param("lastDate") Date lastDate);
    List<Map<String,Object>> getInoutProductOrder(@Param("sdate") Date sdate,@Param("edate") Date edate);
    Integer updateClientSeq();
    // 2022年2月11日 16:28:33 获取用户在线状态
    List<Map<String,Object>> getUserOnlineStatus();
    void delDuplicateQualifier();
    List<String> getClientAllAddress(String clientSid);

    List<Map<String,Object>> rptQuotation(@Param("sdate") Date sdate,@Param("edate") Date edate,@Param("state") Integer state);
    List<BillType> getMaterialBillType();
    List<Map<String, Object>> getProductCraft8ProductCategories(List<Integer> categoryIdList);
    @MapKey("id")
    List<Map<String, Object>> getExecPlanReportRegisteDtl2Partial01(@Param("machineCode") String machineCode, @Param("isFinished") boolean isFinished);
    @MapKey("id")
    List<Map<String, Object>> getExecPlanReportRegisteDtl2Partial02(@Param("machineCode") String machineCode, @Param("isFinished") boolean isFinished);
    @MapKey("id")
    List<Map<String, Object>> getExecPlanReportRegisteDtl2Partial03(@Param("machineCode") String machineCode, @Param("isFinished") boolean isFinished);
}
